.class Lrexsee/open/TencentOauth$SignatureBase;
.super Ljava/lang/Object;
.source "TencentOauth.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lrexsee/open/TencentOauth;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "SignatureBase"
.end annotation


# instance fields
.field public final httpMethod:Ljava/lang/String;

.field private order:[I

.field public final paramNameList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field public final paramValueList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field public final url:Ljava/lang/String;


# direct methods
.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .param p1, "url"    # Ljava/lang/String;
    .param p2, "httpMethod"    # Ljava/lang/String;

    .prologue
    .line 342
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 343
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lrexsee/open/TencentOauth$SignatureBase;->paramNameList:Ljava/util/ArrayList;

    .line 344
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lrexsee/open/TencentOauth$SignatureBase;->paramValueList:Ljava/util/ArrayList;

    .line 345
    iput-object p1, p0, Lrexsee/open/TencentOauth$SignatureBase;->url:Ljava/lang/String;

    .line 346
    iput-object p2, p0, Lrexsee/open/TencentOauth$SignatureBase;->httpMethod:Ljava/lang/String;

    .line 347
    return-void
.end method

.method private order()V
    .locals 7

    .prologue
    .line 375
    iget-object v6, p0, Lrexsee/open/TencentOauth$SignatureBase;->paramNameList:Ljava/util/ArrayList;

    invoke-virtual {v6}, Ljava/util/ArrayList;->size()I

    move-result v5

    .line 376
    .local v5, "size":I
    new-array v6, v5, [I

    iput-object v6, p0, Lrexsee/open/TencentOauth$SignatureBase;->order:[I

    .line 379
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    if-lt v0, v5, :cond_0

    .line 390
    return-void

    .line 380
    :cond_0
    iget-object v6, p0, Lrexsee/open/TencentOauth$SignatureBase;->paramNameList:Ljava/util/ArrayList;

    invoke-virtual {v6, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    .line 381
    .local v3, "name1":Ljava/lang/String;
    const/4 v2, 0x0

    .line 382
    .local v2, "k":I
    const/4 v1, 0x0

    .local v1, "j":I
    :goto_1
    if-lt v1, v5, :cond_1

    .line 388
    iget-object v6, p0, Lrexsee/open/TencentOauth$SignatureBase;->order:[I

    aput v0, v6, v2

    .line 379
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 383
    :cond_1
    iget-object v6, p0, Lrexsee/open/TencentOauth$SignatureBase;->paramNameList:Ljava/util/ArrayList;

    invoke-virtual {v6, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    .line 384
    .local v4, "name2":Ljava/lang/String;
    invoke-virtual {v3, v4}, Ljava/lang/String;->compareTo(Ljava/lang/String;)I

    move-result v6

    if-lez v6, :cond_2

    .line 385
    add-int/lit8 v2, v2, 0x1

    .line 382
    :cond_2
    add-int/lit8 v1, v1, 0x1

    goto :goto_1
.end method


# virtual methods
.method public add(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .param p1, "name"    # Ljava/lang/String;
    .param p2, "value"    # Ljava/lang/String;

    .prologue
    .line 349
    iget-object v0, p0, Lrexsee/open/TencentOauth$SignatureBase;->paramNameList:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 350
    iget-object v0, p0, Lrexsee/open/TencentOauth$SignatureBase;->paramValueList:Ljava/util/ArrayList;

    invoke-virtual {v0, p2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 351
    return-void
.end method

.method public get()Ljava/lang/String;
    .locals 6

    .prologue
    const-string v4, "UTF-8"

    const-string v4, "&"

    .line 353
    new-instance v2, Ljava/lang/StringBuffer;

    invoke-direct {v2}, Ljava/lang/StringBuffer;-><init>()V

    .line 355
    .local v2, "sb":Ljava/lang/StringBuffer;
    :try_start_0
    iget-object v4, p0, Lrexsee/open/TencentOauth$SignatureBase;->httpMethod:Ljava/lang/String;

    invoke-virtual {v2, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 356
    const-string v4, "&"

    invoke-virtual {v2, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 357
    iget-object v4, p0, Lrexsee/open/TencentOauth$SignatureBase;->url:Ljava/lang/String;

    const-string v5, "UTF-8"

    invoke-static {v4, v5}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 358
    const-string v4, "&"

    invoke-virtual {v2, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 359
    invoke-direct {p0}, Lrexsee/open/TencentOauth$SignatureBase;->order()V

    .line 360
    iget-object v4, p0, Lrexsee/open/TencentOauth$SignatureBase;->paramNameList:Ljava/util/ArrayList;

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v3

    .line 361
    .local v3, "size":I
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_0
    if-lt v1, v3, :cond_0

    .line 372
    .end local v1    # "i":I
    .end local v3    # "size":I
    :goto_1
    invoke-virtual {v2}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v4

    return-object v4

    .line 362
    .restart local v1    # "i":I
    .restart local v3    # "size":I
    :cond_0
    :try_start_1
    iget-object v4, p0, Lrexsee/open/TencentOauth$SignatureBase;->paramNameList:Ljava/util/ArrayList;

    iget-object v5, p0, Lrexsee/open/TencentOauth$SignatureBase;->order:[I

    aget v5, v5, v1

    invoke-virtual {v4, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    invoke-virtual {v2, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 363
    const-string v4, "%3D"

    invoke-virtual {v2, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 364
    iget-object v4, p0, Lrexsee/open/TencentOauth$SignatureBase;->paramValueList:Ljava/util/ArrayList;

    iget-object v5, p0, Lrexsee/open/TencentOauth$SignatureBase;->order:[I

    aget v5, v5, v1

    invoke-virtual {v4, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/String;

    const-string v5, "UTF-8"

    invoke-static {v4, v5}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 365
    const/4 v4, 0x1

    sub-int v4, v3, v4

    if-ge v1, v4, :cond_1

    .line 366
    const-string v4, "%26"

    invoke-virtual {v2, v4}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 361
    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 369
    .end local v1    # "i":I
    .end local v3    # "size":I
    :catch_0
    move-exception v4

    move-object v0, v4

    .line 370
    .local v0, "e":Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_1
.end method
